package com.netease.controller;

import com.netease.bo.ModelTableBO;
import com.netease.service.ModelTableService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @projectName: modeling-dev
 * @package: com.netease.controller
 * @className: ModelTableController
 * @author: aochong
 * @description: 模型表控制器
 * @date: 2023/4/24 16:12
 * @version: 1.0
 */
@Api(value = "模型接口", tags = {"模型表相关接口"})
@RequestMapping("model")
@RestController
public class ModelTableController {

    @Autowired
    private ModelTableService modelTableService;

    @ApiOperation(value = "模型DDL", notes = "模型表DDL语句生成接口", httpMethod = "POST")
    @PostMapping("/ddl")
    public String ddl(@RequestBody ModelTableBO modelTableBO) {
        return modelTableService.ddlGenerat(modelTableBO);
    }

    @ApiOperation(value = "模型DML", notes = "模型表DML语句生成接口", httpMethod = "POST")
    @PostMapping("/dml")
    public String dml(@RequestBody ModelTableBO modelTableBO) {
        return modelTableService.dmlGenerat(modelTableBO);
    }
}
